002301906c67dbe1cc21c336e16ea8ebb650d776,src/test/java/no/digipost/api/client/DocumentsPreparerTest.java,DocumentsPreparerTest,neverInsertsBlankPageAfterLastAttachment,#,152

Before Change


	@Test
	public void neverInsertsBlankPageAfterLastAttachment() throws IOException {
		primaryDocument.setPreEncrypt();
		Document a1 = new Document(UUID.randomUUID().toString(), "attachment", PDF).setPreEncrypt();
		Document a2 = new Document(UUID.randomUUID().toString(), "attachment", PDF).setPreEncrypt();
		documents.put(primaryDocument, printablePdf2Pages());
		documents.put(a1, printablePdf1Page());
		documents.put(a2, printablePdf1Page());
		Message message = messageBuilder.attachments(asList(a1, a2)).build();
		Map<Document, InputStream> preparedDocuments = preparer.prepare(documents, message, encrypter);

		@SuppressWarnings("unchecked")

After Change


	public void neverInsertsBlankPageAfterLastAttachment() throws IOException {
		primaryDocument.setPreEncrypt();
		documents.put(primaryDocument, printablePdf2Pages());
		Document a1 = addAttachment("attachment", PDF, printablePdf1Page()).setPreEncrypt();
		Document a2 = addAttachment("attachment", PDF, printablePdf1Page()).setPreEncrypt();
		Message message = messageBuilder.build();
		Map<Document, InputStream> preparedDocuments = preparer.prepare(documents, message, encrypter);